<?php
require_once("../../resources/commons.php");
require_once("../../data/User.php");
require_once("../../data/Report.php");
require_once("HTTP.php");

SessionManager::getInstance()->checkSession();

$l_reportId=base64_decode($_REQUEST["id"]);
if(isset($l_reportId)){
	$l_report=Report::getFromPrimaryKey($l_reportId);
	$l_user=User::getFromPrimaryKey(SessionManager::getCurrentLoggedUserId());
	if(isset($l_report)){
		$l_report->setValidated(true);
		$l_report->setCreatedDate(date("Y/m/d", time()));
		$l_report->setValidatingUser_id(SessionManager::getCurrentLoggedUserId());
		$l_report->save();
	}
}

HTTP::redirect("index.php");
?>